package com.wfh.easychat.model.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;

/**
 * @Title: UserContactStatusEnum
 * @Author wangfenghuan
 * @Package com.wfh.easychat.model.enums
 * @Date 2025/10/1 15:36
 * @description: 好友联系人状态枚举
 */
@Getter
public enum UserContactStatusEnum {

    /**
     * 联系人状态枚举
     */
    NOT_FRIEND("非好友", 0),
    FRIEND("好友", 1),
    DEL("已删除好友", 1),
    DEL_BE("被好友删除", 3),
    BLACKLIST("已拉黑好友", 4),
    BLACKLIST_BE("被好友拉黑", 5);

    UserContactStatusEnum(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }

    public static UserContactStatusEnum getByValue(Integer value) {
        if (ObjectUtil.isEmpty(value)) {
            return null;
        }
        for (UserContactStatusEnum userContactStatusEnum : UserContactStatusEnum.values()) {
            if (userContactStatusEnum.value.equals(value)) {
                return userContactStatusEnum;
            }
        }
        return null;
    }

    private Integer value;
    private String desc;
}
